home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CICA 1995 August
/
CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso
/
disc2
/
demo
/
gcp_24.exe
/
NOTEPAD.FR_
/
NOTEPAD.FR
Wrap
Text File
|
1994-04-28
|
9KB
|
352 lines
VERSION 2.00
Begin Form frmNotePad
BackColor = &H00000000&
Caption = "VT220 Control Demo from Dart"
ClientHeight = 4470
ClientLeft = 1260
ClientTop = 1770
ClientWidth = 6765
ClipControls = 0 'False
DrawStyle = 5 'Transparent
FillColor = &H00FFFFFF&
Height = 5130
Left = 1215
LinkTopic = "Form1"
MDIChild = -1 'True
ScaleHeight = 4470
ScaleWidth = 6765
Top = 1155
Visible = 0 'False
Width = 6855
Begin GCP_220 VT1
Align = 1 'Align Top
AutoWrap = -1 'True
BackColor = 0 'BLACK
Backspace = 0 'DEL
BoldColor = 3 'CYAN
CharSet = 0 'DEC Large
CommSettings = "COM2:9600,n,8,1"
CursorKeys = 0 'Normal
EditKeys = 0 'DEC Map
FlowControl = 2 'Hardware (TRS/CTS)
ForeColor = 7 'WHITE
Height = 2895
Keypad = 0 'Numeric
Left = 0
LocalEcho = 0 'False
Password = ""
PasswordPrompt = "assword:"
PrintMode = 0 'Normal
Protocol = 1 'TELNET
RemoteAddress = ""
TabIndex = 1
TermType = 0 'VT200
Top = 0
Username = ""
UsernamePrompt = "ogin:"
Width = 6765
End
Begin TextBox Text1
Height = 375
Left = 360
TabIndex = 0
Text = "Text1"
Top = 3960
Visible = 0 'False
Width = 2655
End
Begin Menu mnuFile
Caption = "&File"
Begin Menu mnuFNewSession
Caption = "&New..."
End
Begin Menu mnuFClose
Caption = "&Close"
End
Begin Menu mnuFSep1
Caption = "-"
End
Begin Menu mnuFPrintScreen
Caption = "Save Screen"
End
Begin Menu mnuFSelectPrinter
Caption = "Printer Setup..."
End
Begin Menu mnuFSep2
Caption = "-"
End
Begin Menu mnuFExit
Caption = "E&xit"
End
End
Begin Menu mnuEdit
Caption = "&Edit"
Begin Menu mnuECopy
Caption = "&Copy"
End
Begin Menu mnuEPaste
Caption = "&Paste"
End
Begin Menu mnuEClear
Caption = "C&lear"
End
End
Begin Menu mnuOptions
Caption = "&Options"
Begin Menu mnuConnect
Caption = "Connect..."
End
Begin Menu mnuDisconnect
Caption = "Disconnect"
End
Begin Menu mnuSep2
Caption = "-"
End
Begin Menu mnuOColor
Caption = "C&olor..."
End
Begin Menu mnuFont
Caption = "&Font..."
End
Begin Menu mnuOKey
Caption = "&Key Maps..."
End
Begin Menu mnuODialup
Caption = "Dialup Settings..."
End
Begin Menu mnuOTerminal
Caption = "&Terminal..."
End
Begin Menu mnuOSep1
Caption = "-"
End
Begin Menu mnuFShowServer
Caption = "&Show TELNET Server"
End
Begin Menu mnuFHideServer
Caption = "&Hide TELNET Server"
End
End
Begin Menu mnuWindow
Caption = "&Window"
WindowList = -1 'True
Begin Menu mnuWCascade
Caption = "&Cascade"
End
Begin Menu mnuWTile
Caption = "&Tile"
End
Begin Menu mnuWArrange
Caption = "&Arrange Icons"
End
End
Begin Menu mnuHelp
Caption = "&Help"
Begin Menu mnuHAbout
Caption = "About..."
End
End
End
Sub Form_Load ()
ExitFlag = False
End Sub
Sub Form_QueryUnload (Cancel As Integer, UnloadMode As Integer)
If (VT1.OpenComm) Then
Cancel = True
Me.Caption = FState(Me.Tag).Session & " - closing..."
VT1.OpenComm = False
Else
Cancel = False
End If
End Sub
Sub Form_Resize ()
If windowstate <> 1 And ScaleHeight <> 0 Then
VT1.Height = ScaleHeight
End If
End Sub
Sub Form_Unload (Cancel As Integer)
FState(Tag).Deleted = True
' Any other forms?
If (Not Sessions()) Then
frmMDI.Icon = LoadPicture("net09b.ico") ' closed icon
FIndex = 0
End If
End Sub
Sub mnuConnect_Click ()
If frmMDI.ActiveForm.VT1.Protocol = 1 Then 'telnet
CenterForm frmMDI, ConnectDlg
ConnectDlg.Show modal
Else
CenterForm frmMDI, DialUpDlg
DialUpDlg.Show modal
End If
End Sub
Sub mnuDisconnect_Click ()
Disconnect = True
'reset modem if protocol is async
'If frmMDI.ActiveForm.VT1.Protocol = 1 Then
frmMDI.ActiveForm.VT1.OpenComm = False
'End If
End Sub
Sub mnuEClear_Click ()
VT1.ClearScreen = True
End Sub
Sub mnuECopy_Click ()
VT1.Copy = True
End Sub
Sub mnuEPaste_Click ()
VT1.Paste = True
End Sub
Sub mnuFClose_Click ()
If VT1.OpenComm = False Then
Unload Me
Else
VT1.OpenComm = False
End If
End Sub
Sub mnuFExit_Click ()
' Unloading the MDI form invokes the QueryUnload event
' for each child form, then the MDI form - before unloading
' the MDI form. Setting the Cancel argument to True in any of the
' QueryUnload events aborts the unload.
'For i = 1 To Sessions()
'set exit flag
ExitFlag = True
Unload frmMDI
'Next i
'Unload Me
End Sub
Sub mnuFHideServer_Click ()
VT1.ShowServer = False
End Sub
Sub mnuFNewSession_Click ()
CenterForm frmMDI, NewSession
NewSession.Show 1
End Sub
Sub mnuFont_Click ()
'Load CharSetDlg
CenterForm frmMDI, CharSetDlg
CharSetDlg.Show modal
End Sub
Sub mnuFOpenSession_Click ()
LoadConfig (PrevSess)
End Sub
Sub mnuFPrintScreen_Click ()
VT1.PrintScreen = "screen"
End Sub
Sub mnuFSelectPrinter_Click ()
VT1.SelectPrinter = True
End Sub
Sub mnuFShowServer_Click ()
VT1.ShowServer = True
End Sub
Sub mnuHAbout_Click ()
frmAbout.Show 1
End Sub
Sub mnuHContents_Click ()
r = Shell("WinHelp.exe vt220fwg.hlp")
End Sub
Sub mnuOColor_Click ()
CenterForm frmMDI, ColorDlg
ColorDlg.Show modal
End Sub
Sub mnuODialup_Click ()
CenterForm frmMDI, ConfigScrn
ConfigScrn.Show modal
End Sub
Sub mnuOKey_Click ()
Load Keyboard
Keyboard.Show modal
End Sub
Sub mnuOpenConnect_Click ()
LoadConfig (OpenPrevSess)
End Sub
Sub mnuOTerminal_Click ()
CenterForm frmMDI, Emulation
Emulation.Show 1
End Sub
Sub mnuWArrange_Click ()
frmMDI.Arrange ARRANGE_ICONS
End Sub
Sub mnuWCascade_Click ()
frmMDI.Arrange CASCADE
End Sub
Sub mnuWTile_Click ()
frmMDI.Arrange TILE_HORIZONTAL
End Sub
Sub Text1_Change ()
FState(Me.Tag).Dirty = True
End Sub
Sub VT1_Console (Message As String)
MsgBox Message, 64 + 4096, "Console Message from VT-220"
End Sub
Sub VT1_OnCloseComm (ErrorCode As Integer)
If Left$(Me.Caption, InStr(Me.Caption, " ") - 1) = FState(FIndex).Session Then
Me.Caption = FState(FIndex).Session & " - closed"
End If
If ExitFlag Then
Unload frmMDI
End If
If Disconnect = False Then
Me.Icon = LoadPicture("net09b.ico") ' closed icon
Unload Me
End If
If FIndex > 0 Then Me.mnuConnect = True
End Sub
Sub VT1_OnOpenComm (ErrorCode As Integer)
If ErrorCode Then
Me.Caption = FState(Me.Tag).Session & " - closed"
OpenComm = False
Icon = LoadPicture("net09b.ico")
Else
Me.Caption = FState(Me.Tag).Session & " - open"
' Icon shows us open
frmMDI.Icon = LoadPicture("net09a.ico")
Icon = LoadPicture("net09a.ico")
' if a dialup and init string is not empty, send init string otherwise don't send string and turn dialup off
If VT1.Protocol = 0 And FState(Me.Tag).ModemInitString > "" Then
VT1.Output = FState(Me.Tag).ModemInitString & FState(Me.Tag).Dial & FState(Me.Tag).Phone & Chr$(13)
Else
Me.mnuODialup = False
End If
Me.mnuConnect = False
End If
Disconnect = False
End Sub